﻿using PlatformUW.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PlatformUW.EntityFramework.Repositories.Extensions
{
    public static class SensorRepositoryExtensions
    {
        public static IQueryable<SensorTable> FilterByName(this IQueryable<SensorTable> sensors, string? name)
        {
            if (string.IsNullOrWhiteSpace(name))
            {
                return sensors;
            }
            return sensors.Where(player =>
               player.Name.Contains(name.Trim().ToLower()));
        }

    }
}
